<?php

require_once(sfConfig::get('sf_app_lib_dir').'/common/constants/images/ConstantsCommonsImages.php');
require_once(sfConfig::get('sf_app_lib_dir').'/common/html/tags/body/component/ImageDivComponent.php');
require_once(sfConfig::get('sf_app_lib_dir').'/common/constants/ConstantsCommons.php');
require_once(sfConfig::get('sf_app_lib_dir').'/common/html/tags/body/component/ImageTagAComponent.php');
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BodyHeader
 *
 * @author jhonny
 */
class ManagerBodyHeader{
    private $logo;
    public function __construct() {
        $this->logo=ConstantsCommonsImages::$pathLogo;
    }
    public function getLogo() {
        return $this->logo;
    }

    public function setLogo($logo) {
        $this->logo = $logo;
    }

    private function getStrLogo(){
        $value='';
        if($this->getLogo()!=null){
            $div = new DivTag();
            $image = new ImageTagAComponent();
//            $image->setId("logohead");
            $image->setAlt("Logo Tengo una Cita");
            $image->setSource($this->getLogo());
            $image->setHref("#");
            $div->setId("logohead");
            $div->setComponent($image);
            $value.=$div->toString();
        }
        return $value;
    }
    private function getStrMenu(){
        $value='    ';
        $value.='<div id="menuheadContent">';
        $value.='<div id="menuhead">';
        $value.=$this->getStrLoginUser();
        $value.='</div>';
        $value.='</div>';
        return $value;
    }
    private function getStrLoginUser(){
        $value='';
        $value.='<div id="login">';
        $value.='   <form method="POST" action="'.url_for('@sf_guard_signin').'">';
        $value.='       <div id="loginInput">';
//        $value.=$form['username'];
        $value.='           <input class="loginInputText" type="text" name="username" value="Usuario"/>  ';
        $value.='<div id="separarUserPass"></div>';
//        $value.=$form['password'];
        $value.='           <input class="loginInputText" type="password" name="passwort"value="clave"/>';
        $value.='<div id="separarButtonLogin"></div>';
        $value.='           <input id="loginButton" type="submit" value="" />';
        $value.='           <br/>';
        $value.='           <div id="loginremember">';

//        $value.='               <fieldset><input type="checkbox" name="remember" value="remember" id="foo_field" checked><label for="foo_field"></label></fieldset>';
        $value.='    <input id="loginchekbox" type="checkbox" name="remember" checked>';
//        $value.=$form['remember']->render();
        $value.='               <div id="loginrememberText">';
        $value.='                   <div id="loginrememberLabel">Recordar</div>';
        $value.='                   <div id="separarTextLoginRemember"></div>';
        $value.='                   <div id="loginrememberLabel">';
        $value.=                        $this->builtLink("#", "¿Olvidaste la contraseña?");
        $value.='                   </div>';
        $value.='               </div>';
        $value.='           </div>';
        $value.='       </div>';
//        $value.=$form['_csrf_token'];
        $value.='   </form>';
        $value.='</div>';
        return $value;
    }

    private function builtTextEspecial($class,$letra,$text){
        $value = '';        
        $value.= '<span id="'.$class.'">'.$letra.'</span>'.$text;
        
        return $value;
    }
    private function builtLink($link,$text){
        $value = '';
        $tag = new TagAComponent();
        $tag->setHref($link);
        $tag->setText($text);
        $value.=$tag->toString();
        return $value;
    }
    private function getStrAyudaContacto(){
        $value='    ';
        $value.='<div id="ayudacontacto">
            ';
        $value.=$this->builtLink("#", "AYUDA");
        $value.=' <b>·&nbsp;</b> ';
        $value.=$this->builtLink("#", "CONTACTO");
        $value.='</div>
            ';
        return $value;
    }
    public function toString() {
        $value='    ';
        $value.='<div id="bodyhead">
            ';
        $value .= $this->getStrLogo();
        $value .= $this->getStrMenu();
        $value .= $this->getStrAyudaContacto();
        $value.='</div>
            ';
        return $value;
    }
}
?>

